-
Notifications
You must be signed in to change notification settings - Fork 273
Feature expr2c extension #2599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature expr2c extension #2599
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passed Diffblue compatibility checks (cbmc commit: 659aa44).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80160965
@@ -1998,14 +1918,12 @@ std::string expr2ct::convert_constant_bool(bool boolean_value) | |||
{ | |||
// C doesn't really have these | |||
if(boolean_value) | |||
return "TRUE"; | |||
return "1"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the boolean value was the original reason for this commit.
I am sorry for the reformatting around this change in the commit.
My intend was to change TRUE to 1 and FALSE to 0.
659aa44
to
131bb8c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 131bb8c).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80535721
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
131bb8c
to
1381399
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR failed Diffblue compatibility checks (cbmc commit: 1381399).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/80797564
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
@thk123 Have you had a chance to take a look on this? I might provide some support in merging this with other PR into a joined version und your guidance, if that helps. I really would appreciate, if the output of expr2ct becomes compilable soon. |
Thanks, so I will close this PR in favor of #2704. |
I tried to convert an exprt to compilable c code, but encountered some problems as struct type definitions and padding struct members are contained in the output.
This changes add a new class, that is capable to remove them from the conversion output.
Changing the behavior of expr2ct with parameters doesn't seem an easily feasible approach.
Further, "TRUE" and "FALSE" are not understood by the c compiler in the default case. I suggest to replace them with some accepted replacement values.